package com.toivan.mt.model;

import java.util.Iterator;
import java.util.List;

public class MtAtmosphereManager {

    private List<MtAtmosphere> atmospheres;

    public List<MtAtmosphere> getAtmospheres() {
        return atmospheres;
    }

    public void setAtmospheres(List<MtAtmosphere> atmospheres) {
        this.atmospheres = atmospheres;
    }

    MtAtmosphere findAtmosphere(String name) {
        Iterator iterator = this.atmospheres.iterator();
        MtAtmosphere atmosphere;
        do {
            if (!iterator.hasNext()) {
                return null;
            }
        } while(!name.equals((atmosphere = (MtAtmosphere) iterator.next()).getName()));

        return atmosphere;
    }
}
